home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
winter_challenge.swf
/
scripts
/
frame_44
/
PlaceObject2_138_182
/
CLIPACTIONRECORD onClipEvent(load).as
< prev
Wrap
Text File
|
2011-08-19
|
7KB
|
239 lines
onClipEvent(load){
function ATVcontrol(faktorN, faktorP, fG, rG)
{
if(Key.isDown(37) && Key.isDown(38))
{
this.ATV.gotoAndStop("left");
_rotation = _rotation - faktorN;
}
if(Key.isDown(39) && Key.isDown(38))
{
this.ATV.gotoAndStop("right");
_rotation = _rotation + faktorP;
}
if(Key.isDown(37) && w > 0.1 && !Key.isDown(38) && !Key.isDown(40))
{
this.ATV.gotoAndStop("left");
_rotation = _rotation - faktorN;
}
if(Key.isDown(39) && w > 0.1 && !Key.isDown(38) && !Key.isDown(40))
{
this.ATV.gotoAndStop("right");
_rotation = _rotation + faktorP;
}
if(Key.isDown(37) && w < 0 && !Key.isDown(38) && !Key.isDown(40))
{
this.ATV.gotoAndStop("left");
_rotation = _rotation + faktorN;
}
if(Key.isDown(39) && w < 0 && !Key.isDown(38) && !Key.isDown(40))
{
this.ATV.gotoAndStop("right");
_rotation = _rotation - faktorP;
}
if(Key.isDown(37) && Key.isDown(40))
{
this.ATV.gotoAndStop("left");
if(w > 0)
{
_rotation = _rotation - faktorP;
}
else if(w < 0)
{
_rotation = _rotation + faktorP;
}
}
if(Key.isDown(39) && Key.isDown(40))
{
this.ATV.gotoAndStop("right");
if(w > 0)
{
_rotation = _rotation + faktorN;
}
else if(w < 0)
{
_rotation = _rotation - faktorN;
}
}
if(Key.isDown(38))
{
if(Key.isDown(38) && !Key.isDown(37) && !Key.isDown(39))
{
this.ATV.gotoAndStop("normal");
}
antrieb();
}
if(Key.isDown(40))
{
if(Key.isDown(40) && !Key.isDown(37) && !Key.isDown(39))
{
this.ATV.gotoAndStop("normal");
}
antrieb();
}
if(Key.isDown(38) && w > - fG && w < fG)
{
if(Key.isDown(40))
{
w = w;
}
else
{
w += acceleration;
}
}
if(Key.isDown(40) && w > - rG && w < fG)
{
if(Key.isDown(38))
{
w = w;
}
else
{
w -= acceleration;
}
}
if(w > 0.1 && !Key.isDown(38) && !Key.isDown(40))
{
antrieb();
w -= breakverzoegerung;
}
if(w < -0.1 && !Key.isDown(38) && !Key.isDown(40))
{
antrieb();
w += breakverzoegerung;
}
if(w < 0.1 && !Key.isDown(38) && !Key.isDown(40) && w >= 0)
{
w = 0;
}
if(w > -0.1 && !Key.isDown(38) && !Key.isDown(40) && w <= 0)
{
w = 0;
}
if(Key.isDown(39) != 1 && Key.isDown(37) != 1 && Key.isDown(38) != 1 && Key.isDown(40) != 1)
{
this.ATV.gotoAndStop("normal");
}
}
function antrieb()
{
_Y = _Y - Math.cos(0.017453292519943295 * _rotation) * w;
_X = _X + Math.sin(0.017453292519943295 * _rotation) * w;
}
function checkIntersect()
{
if(counterFlag == 1)
{
delayCounter++;
if(delayCounter >= 24)
{
counterFlag = 0;
delayCounter = 0;
}
}
if(_root.track_1.hitTest(_root.ATVclip.getBounds(_root).xMax + w,_root.ATVclip.new_y,true))
{
trace("hit: nMax, _y");
thisSound = _root.bang1;
newVolume = setSoundVolume(thisSound);
thisSound.setVolume(newVolume);
thisSound.start(0,1);
if(counterFlag != 1 && _root.redTire_cheat == 0)
{
counterFlag = 1;
}
return undefined;
}
if(_root.track_1.hitTest(_root.ATVclip.getBounds(_root).xMin - w,_root.ATVclip.new_y,true))
{
trace("hit: xMin, _y");
thisSound = _root.bang1;
newVolume = setSoundVolume(thisSound);
thisSound.setVolume(newVolume);
thisSound.start(0,1);
if(counterFlag != 1 && _root.redTire_cheat == 0)
{
reduceShields(0,Math.abs(w));
}
counterFlag = 1;
return undefined;
}
if(_root.track_1.hitTest(_root.ATVclip.new_x,_root.ATVclip.getBounds(_root).yMax + w,true))
{
trace("hit: _x, yMax");
thisSound = _root.bang1;
newVolume = setSoundVolume(thisSound);
thisSound.setVolume(newVolume);
thisSound.start(0,1);
if(counterFlag != 1 && _root.redTire_cheat == 0)
{
reduceShields(0,Math.abs(w));
}
counterFlag = 1;
return undefined;
}
if(_root.track_1.hitTest(_root.ATVclip.new_x,getBounds(_root).yMin - w,true))
{
trace("hit: _x, yMin");
thisSound = _root.bang1;
newVolume = setSoundVolume(thisSound);
thisSound.setVolume(newVolume);
thisSound.start(0,1);
if(counterFlag != 1 && _root.redTire_cheat == 0)
{
reduceShields(0,Math.abs(w));
}
counterFlag = 1;
return undefined;
}
}
function reduceShields(scoreReduce, hitpointReduce)
{
_root.ATVclip.shield.gotoAndPlay(2);
_root.ATVclip.shield._alpha -= hitpointReduce;
_root.score -= scoreReduce;
_root.hitpoints -= hitpointReduce;
if(_root.score < 0)
{
_root.score = 0;
}
if(_root.hitpoints < 0)
{
_root.hitpoints = 0;
}
if(_root.hitpoints <= 0)
{
_root._highquality = 1;
myTarget = "lose" + _root.course;
_root.gotoAndStop(myTarget);
}
}
function checkForMines()
{
mineTimer++;
if(Key.isDown(77) && mineTimer >= mineDelay)
{
mineCount++;
mineTimer = 0;
newMineName = "newMine" + mineCount;
duplicateMovieClip(_root.mineClip,newMineName,16384 + mineCount);
newMine = eval("_root." + newMineName);
newMine._x = this._x;
newMine._y = this._y;
newMine._visible = 1;
_root.mine.start(0,0);
newMine.gotoAndPlay(2);
}
}
antriebsModus = "grip";
_root.hitpoints = 100;
PI = 3.141592653589793;
this.thrust._visible = 0;
this._rotation = 90;
this.swapDepths(690);
mineCount = 0;
mineTimer = 0;
mineDelay = 48;
}